<template>
	<view class="box">
		<task v-if="curTab=='task'"></task>
		<me v-if="curTab=='me'"></me>
		<view class="cu-bar tabbar bg-white foot">
			<view class="action" @click="curTab = 'task'">
				<view class="cuIcon-cu-image">
					<image :src=" '/static/images/tabbar/' + (curTab == 'task'?'basics_cur.png':'basics.png')"></image>
				</view>
				<view :class="curTab == 'task'?'text-green':'text-gray'">订单</view>
			</view>
			<view class="action">
				<view class="cuIcon-cu-image">
					<image src="/static/images/tabbar/component.png"></image>
				</view>
				<view :class="curTab == 'pd'?'text-green':'text-gray'">待开发</view>
			</view>
			<view class="action">
				<view class="cuIcon-cu-image">
					<image src="/static/images/tabbar/plugin.png"></image>
					<view class="cu-tag badge">99</view>
				</view>
				<view :class="curTab == 'pd'?'text-green':'text-gray'">待开发</view>
			</view>
			<view class="action" @click="curTab = 'me'">
				<view class="cuIcon-cu-image">
					<image :src=" '/static/images/tabbar/' + (curTab == 'me'?'about_cur.png':'about.png')"></image>
					<view class="cu-tag badge"></view>
				</view>
				<view :class="curTab == 'me'?'text-green':'text-gray'">我的</view>
			</view>
		</view>
		</view>
	</view>
</template>

<script>
	
	import task from '../task/index.vue'
	import me from '../me/index.vue'
	
	export default {
		components:{
			task:task,
			me:me
		},
		data() {
			return {
				title: 'Hello',
				token: 'Hello',
				curTab:'task'
			}
		},
		onLoad(options) {
			//	console.log(options.token)
			//	this.token = options.token;
			//	localStorage.setItem('token',options.token);
		},
		methods: {
			NavChange: function(e) {
				this.PageCur = e.currentTarget.dataset.cur;
			},
		
			callFlutter() {
				// 检查FlutterWebViewChannel是否存在
				if (window.FlutterWebViewChannel) {
					// 发送消息到Flutter
					window.FlutterWebViewChannel.postMessage('refresh');
			
					// 或者发送带数据的消息
					window.FlutterWebViewChannel.postMessage('data:这是来自JS的数据');
				}
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}

</style>
